package metalink.student;
import com.opensymphony.xwork2.ActionSupport;
import java.util.*;
import java.sql.*;

import vo.*;
import vo.mixed.*;
import model.admin.*;
import myutil.*;


public class NewStudentMessage extends ActionSupport{
	ArrayList<StudentDetailsVo> student_list=new ArrayList<StudentDetailsVo>();
	public ArrayList<StudentDetailsVo> getStudent_list() {
		return student_list;
	}
	public void setStudent_list(ArrayList<StudentDetailsVo> student_list) {
		this.student_list = student_list;
	}
	public ArrayList<CollegeStaffVo> getStaff_list() {
		return staff_list;
	}
	public void setStaff_list(ArrayList<CollegeStaffVo> staff_list) {
		this.staff_list = staff_list;
	}
	ArrayList<CollegeStaffVo> staff_list=new ArrayList<CollegeStaffVo>();
	public String execute(){
		try {
			Connect c=new Connect();
			ResultSet rs=c.getResult("select * from student_details");
			while(rs.next()){
				StudentDetailsVo single_object=new StudentDetailsVo();
				single_object.setEmail_id(rs.getString("email_id"));
				single_object.setStudent_name(rs.getString("student_name"));
				student_list.add(single_object);
			}
			
			rs=c.getResult("select * from college_staff");
			while(rs.next()){
				CollegeStaffVo single_object=new CollegeStaffVo();
				single_object.setEmail_id(rs.getString("email_id"));
				single_object.setStaff_name(rs.getString("staff_name"));
				staff_list.add(single_object);
			}
			return SUCCESS;
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return ERROR;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return ERROR;
		}
		
	}

}
